<?php
/**
 * @author Nguyễn Sơn Tùng <sontung.x305@gmail.com> <Y!M: terminator_nst> <Skype : joker.x305>
 * @version: 1.0
 * @copyright fteam.vn
 * Date: 25/03/2013
 * Time: 10:53
 */
class YbFormModel extends CFormModel
{
    public $name;
    public $description;
    public $video_tags;

    public function rules()
    {
        return array(
            array('name,description', 'required'),
            array('name,description,video_tags', 'safe'),
        );
    }

    // Change the labels here
    public function attributeLabels()
    {
        return array(
            'name'=>t('Title','YbFormModel'),
            'description'=>t('Description','YbFormModel'),
            'video_tags'=>t('Tags','YbFormModel'),
        );
    }

    // return the formbuilder config
    public function getFormConfig()
    {
     return array(
            'title' => t('Upload Videos to YouTube','YbFormModel'),
            'showErrorSummary' => false,
            'elements' => array(
                'name' => array(
                    'type' => 'text',
                    'maxlength' => 100,
                    'class' => 'input-large',
                    'append' => '<i class="brocco-icon-camera-2"></i>',
                ),
                'description' => array(
                    'type' => 'textarea',
                    'maxlength' => 100,
                    'class' => 'input-large',
                ),
                'video_tags' => array(
                    'type' => 'text',
                    'maxlength' => 255,
                    'class' => 'input-large',
                    'append' => '<i class="brocco-icon-camera-2"></i>',
                ),
            ),
     'buttons' => array(
        'submit' => array(
            'type' => 'submit', //@see TbFormButtonElement::$TbButtonTypes
            'layoutType' => 'primary', //@see TbButton->type
            'label' => 'Submit',
        ),
        'reset' => array(
            'type' => 'reset',
            'label' => 'Reset',
        ),
    ),
        );
    }
}